<?php
include_once "xAP-functions/webincludes.php";
if(intval($extradata["sourceid"])>0){
	// just one source
	$sql="select Location from xAP_Weather_Source
	where Active=1 and SourceID=".intval($extradata["sourceid"])."
	";
	$results=dbquery($sql);
	$title=$results[0]["Location"];
}
else
{
	$title="Current Weather";
}
$script="
<script type=\"text/javascript\" >
$(document).ready(function(){
	CurrentWeatherUpdate".$widgetID."();
	setInterval('CurrentWeatherUpdate".$widgetID."()',10*60000);
});
function CurrentWeatherUpdate".$widgetID."(){	
	$(\"#CurrentWeatherUpdate".$widgetID."\").load(\"/".$config["modulefolder"]."/widget_CurrentWeather_data.php?id=".intval($extradata["sourceid"])."\");
}
</script>";
$body="<div class='boldtext' id='CurrentWeatherUpdate".$widgetID."'></div>";
echo LayoutWidget("widget_CurrentWeather",$title,$body,$widgetID,$script);
?>